package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile    string `gorm:"type:char(11)"`
	Password  string `gorm:"type:char(32)"`
	HeadImage string `gorm:"type:varchar(500)"`
	NickName  string `gorm:"type:varchar(40)"`
}

// 分类表
type Class struct {
	gorm.Model
	Name    string `gorm:"type:varchar(40)"`
	UserId  int64  `gorm:"type:int(11)"`
	GoodNum int64  `gorm:"type:int(11)"`
}

// 商品表
type Goods struct {
	gorm.Model
	Title      string  `gorm:"type:varchar(40)"`
	ClassId    int64   `gorm:"type:int(11)"`
	Price      float64 `gorm:"type:decimal(10,2)"`
	Info       string  `gorm:"type:varchar(200)"`
	UserId     int64   `gorm:"type:int(11)"`
	CollectNum int64   `gorm:"type:int(11)"`
}

// 收藏表
type Collect struct {
	gorm.Model
	GoodsId int64 `gorm:"type:int(11)"`
	UserId  int64 `gorm:"type:int(11)"`
}

// 评价表
type Comment struct {
	gorm.Model
	Context string `gorm:"type:varchar(500)"`
	GoodsId int64  `gorm:"type:int(11)"`
	UserId  int64  `gorm:"type:int(11)"`
}
type GoodData struct {
	Goods
	ClassName string `gorm:"type:varchar(40)"`
	GoodsName string `gorm:"type:varchar(40)"`
}
type CollData struct {
	Collect
	Goods
}
